package zestaw4.zadanie1;

/**
 * Author: Daniel
 * Date: 03.08.13
 */

public class Person implements Comparable<Person> {
    private String name;

    public String getName() {
        return name;
    }

    public Person(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof  Person)) return false;
        Person person = (Person) obj;
        return name.equals(person.name);
    }

    @Override
    public int compareTo(Person o) {
        if (o == null) return -1;
        return name.compareTo(o.getName());
    }
}
